package com.xiaoye.controller;

import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ser.Serializers;
import com.xiaoye.entity.College;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 宵夜
 * @version 1.0.0
 * @Description: TODO
 */
@RestController
public class CollegeController extends BaseController {
    /**
     * 查询所有学院
     */
    @GetMapping("/allColleges")
    public String allColleges(Integer page, Integer rows) {
        return JSONObject.toJSONString(collegeService.pageAllColleges(page, rows));
    }

    /**
     * 编辑、删除学院
     */
    @PostMapping("/editCollege")
    public void editCollege(College college) {
        collegeService.editCollege(college);
    }
}
